package com.weiiew.backend.operationUtils;

import java.awt.event.InputEvent;

public enum MouseCode {
    LEFT(1, InputEvent.BUTTON1_DOWN_MASK),
    RIGHT(2, InputEvent.BUTTON3_DOWN_MASK),
    MIDDLE(3, InputEvent.BUTTON2_DOWN_MASK);

    private final int nativeCode;
    private final int robotMask;

    MouseCode(int nativeCode, int robotMask) {
        this.nativeCode = nativeCode;
        this.robotMask = robotMask;
    }

    public static MouseCode fromNativeCode(int nativeCode) {
        for (MouseCode button : values()) {
            if (button.nativeCode == nativeCode) {
                return button;
            }
        }
        return null;
    }

    public int getRobotMask() {
        return robotMask;
    }
}